@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    --background: 338 56% 94%;
    --foreground: 348 25% 25%;
    --card: 0 0% 100%;
    --card-foreground: 348 25% 25%;
    --popover: 0 0% 100%;
    --popover-foreground: 348 25% 25%;
    --primary: 351 100% 86%;
    --primary-foreground: 351 40% 20%;
    --secondary: 338 40% 90%;
    --secondary-foreground: 348 25% 25%;
    --muted: 338 40% 90%;
    --muted-foreground: 348 15% 55%;
    --accent: 240 67% 94%;
    --accent-foreground: 240 20% 30%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 351 40% 80%;
    --input: 351 40% 83%;
    --ring: 351 100% 86%;
    --radius: 0.8rem;
  }

  .dark {
    --background: 240 10% 10%;
    --foreground: 0 0% 98%;
    --card: 240 10% 12%;
    --card-foreground: 0 0% 98%;
    --popover: 240 10% 10%;
    --popover-foreground: 0 0% 98%;
    --primary: 351 100% 86%;
    --primary-foreground: 351 40% 20%;
    --secondary: 240 5% 15%;
    --secondary-foreground: 0 0% 98%;
    --muted: 240 5% 15%;
    --muted-foreground: 0 0% 63.9%;
    --accent: 240 10% 20%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 5% 20%;
    --input: 240 5% 20%;
    --ring: 351 100% 86%;
  }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground;
  }
}

.sakura-petal {
  position: fixed;
  top: -10px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="%23FFB6C1"><path fill-rule="evenodd" d="M10 2.5c-4.142 0-7.5 3.358-7.5 7.5s3.358 7.5 7.5 7.5 7.5-3.358 7.5-7.5-3.358-7.5-7.5-7.5zM8.5 6a.5.5 0 01.5-.5h2a.5.5 0 010 1h-2a.5.5 0 01-.5-.5zM7 9.5a.5.5 0 00-.5.5v2a.5.5 0 001 0v-2a.5.5 0 00-.5-.5zm6 0a.5.5 0 00-.5.5v2a.5.5 0 001 0v-2a.5.5 0 00-.5-.5z" clip-rule="evenodd" transform="scale(1.5) translate(-3, -3.5)"/><path d="M10 5.07c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5z" opacity="0.3"/></svg>');
  background-size: contain;
  background-repeat: no-repeat;
  width: 20px;
  height: 20px;
  animation: fall linear infinite;
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
}

@keyframes fall {
  0% {
    transform: translateY(0vh) translateX(0vw) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(105vh) translateX(2vw) rotate(360deg);
    opacity: 0;
  }
}

html.rain::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(173, 216, 230, 0.2) 1px, transparent 1px);
  background-size: 1px 10px;
  animation: rain-fall 0.5s linear infinite;
  z-index: 1;
}

@keyframes rain-fall {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 0% 100%;
  }
}

html.cloudy {
  --background: 338 20% 90%;
}
